home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
051-060
/
amok51
/
steprate
/
steprate.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
2KB
|
84 lines
(*-------------------------------------------------------------------------
:Program. StepRate.mod
:Contents. Little tool to set the steprates of the Amiga drives
:Author. Christian Stiens
:Address. Heustiege 2, W-4710 Lüdinghausen
:Copyright. PD
:Language. Oberon
:Translator. Amiga Oberon V1.17.1 A+L
:History. V1.0
:Usage. Steprate {<DFx:> <#Stepdelay|SHOW>}
-------------------------------------------------------------------------*)
MODULE StepRate;
(* $OvflChk- $RangeChk- $CaseChk- $NilChk- $StackChk- $ReturnChk- *)
IMPORT
a : Arguments,
c : Conversions,
e : Exec,
str : Strings,
sys : SYSTEM,
td : TrackDisk,
io : io;
CONST
usage = "Usage: Steprate {<DFx:> <#Stepdelay|SHOW>}\n";
cantOpen = "Can't open trackdisk device\n";
VAR
ior : e.IOStdReq;
arg : ARRAY 80 OF CHAR;
tduPt : POINTER TO ARRAY 4 OF POINTER TO td.TDUPublicUnit;
delay : LONGINT;
drive : INTEGER;
show : BOOLEAN;
narg : INTEGER;
nr : INTEGER;
BEGIN
narg := a.NumArgs();
IF (narg < 2) OR ODD(narg) THEN
io.WriteString(usage); HALT(0)
END;
IF e.OpenDevice(td.trackDiskName,0,sys.ADR(ior),LONGSET{}) # 0 THEN
io.WriteString(cantOpen); HALT(0)
END;
tduPt := sys.VAL(LONGINT,ior.device) + 24H;
nr := 1;
WHILE nr <= narg DO
a.GetArg(nr,arg); str.Upper(arg);
IF (arg[0] = "D") & (arg[1] = "F") THEN
drive := ORD(arg[2]) - ORD("0");
IF (drive >= 0) & (drive <= 3) THEN
a.GetArg(nr+1,arg); str.Upper(arg);
IF c.StringToInt(arg,delay) THEN
IF delay < 1500 THEN delay := 1500 END;
show := FALSE
ELSE
show := TRUE;
END;
IF tduPt[drive] # 0 THEN
IF show THEN
io.WriteString("Stepdelay of drive DF");
io.WriteInt(drive,1);
io.WriteString(": is ");
io.WriteInt(tduPt[drive].stepDelay,1); io.WriteLn;
ELSE
tduPt[drive].stepDelay := delay
END;
ELSE
io.WriteString("Drive DF");
io.WriteInt(drive,1);
io.WriteString(": is not connected\n")
END
END
END;
INC(nr,2)
END; (* WHILE *)
e.CloseDevice(sys.ADR(ior));
END StepRate.